﻿using System;
using System.Text;
using System.Windows.Forms;
using System.Collections.Generic;


namespace EpisodeWizard.CoreUI
{

    // Need a reference to system.design.dll
    public class SelectFolderDialog : System.Windows.Forms.Design.FolderNameEditor
    {

        private string m_Description = "Choose a Directory...";
        private string m_ReturnPath = "";
        private FolderBrowser fb = new FolderBrowser();

        public string Description
        {
            set { m_Description = value; }
        }

        public string ReturnPath
        {
            get { return m_ReturnPath; }
        }

        public DialogResult ShowDialog()
        {
            fb.Description = m_Description;
            fb.StartLocation = FolderBrowserFolder.MyComputer;

            DialogResult r = fb.ShowDialog();
            if (r == DialogResult.OK)
            {
                m_ReturnPath = fb.DirectoryPath;
            }
            else
            {
                m_ReturnPath = "";
            }

            return r;

        }
    }

}
